<?php

/**
 * Project form base class.
 *
 * @method Project getObject() Returns the current form's model object
 *
 * @package    mysmartmanager
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseProjectForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'projectid'   => new sfWidgetFormInputHidden(),
      'projectname' => new sfWidgetFormInputText(),
      'description' => new sfWidgetFormTextarea(),
      'createdate'  => new sfWidgetFormDateTime(),
      //'startdate'   => new sfWidgetFormDateTime(),
      //'enddate'     => new sfWidgetFormDateTime(),
	  
      'startdate'    => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.jpg',
'date_widget' => new sfWidgetFormDate(array('format'=>'%day%/%month%/%year%'))
)),
      'enddate'    => new sfWidgetFormJQueryDate(array('image' => '/images/calendar.jpg', 'date_widget' => new sfWidgetFormDate(array('format'=>'%day%/%month%/%year%')))),
      'createdby'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Resource'), 'add_empty' => false)),
      'status'      => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'projectid'   => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'projectid', 'required' => false)),
      'projectname' => new sfValidatorString(array('max_length' => 150, 'required' => true)),
      'description' => new sfValidatorString(array('required' => false)),
      'createdate'  => new sfValidatorDateTime(array('required' => false)),
      'startdate'   => new sfValidatorDateTime(array('required' => false)),
      'enddate'     => new sfValidatorDateTime(array('required' => false)),
      'createdby'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Resource'), 'required' => false)),
      'status'      => new sfValidatorBoolean(array('required' => false)),
    ));
	
    $this->widgetSchema->setNameFormat('project[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Project';
  }

}
